package plugins.buildjava.projecttype;

import domain.model.project.ProjectDeveloper;
import domain.model.project.ProjectType;
import shared.model.BuilderObject;

import java.util.Collections;
import java.util.List;

/**
 * @author Gregory Boissinot
 */
public class JavaBuildProjectTypeBuilder implements BuilderObject<ProjectType> {

    private RWJavaBuildProjectTypeExtension projectType;

    public JavaBuildProjectTypeBuilder() {
        this.projectType = new JavaBuildProjectTypeImpl();
        this.projectType.setProjectDeveloperList(Collections.EMPTY_LIST);
    }

    public JavaBuildProjectTypeBuilder projectDeveloperList(List<ProjectDeveloper> projectDevelopers) {
        this.projectType.setProjectDeveloperList(projectDevelopers);
        return this;
    }

    public JavaBuildProjectTypeBuilder sourceCompatibility(String sourceCompatibility) {
        this.projectType.setSourceCompatibility(sourceCompatibility);
        return this;
    }

    public JavaBuildProjectTypeBuilder targetCompatibility(String targetCompatibility) {
        this.projectType.setTargetCompatibility(targetCompatibility);
        return this;
    }

    @Override
    public ProjectType build() {
        return projectType;
    }
}
